<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>测试报告</title>
    <meta name="generator" content="HTMLTestRunner 0.8.3"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    
<style type="text/css" media="screen">
body        { font-family: verdana, arial, helvetica, sans-serif; font-size: 80%; }
table       { font-size: 100%; }
pre         { }

/* -- heading ---------------------------------------------------------------------- */
h1 {
	font-size: 16pt;
	color: gray;
}
.heading {
    margin-top: 0ex;
    margin-bottom: 1ex;
}

.heading .attribute {
    margin-top: 1ex;
    margin-bottom: 0;
}

.heading .description {
    margin-top: 4ex;
    margin-bottom: 6ex;
}

/* -- css div popup ------------------------------------------------------------------------ */
a.popup_link {
}

a.popup_link:hover {
    color: red;
}
.img{
	width: 100%;
	height: 100%;
	border-collapse: collapse;
    border: 2px solid #777;
}

.screenshots {
    z-index: 100;
	position:absolute;
	left: 23%;
	top: 20%;
	display: none;
}
.close_shots {
	position:absolute;
	top:0; left:98%;
	z-index:99;
	width:20px;
}
.popup_window {
    display: none;
    position: relative;
    left: 0px;
    top: 0px;
    /*border: solid #627173 1px; */
    padding: 10px;
    background-color: #E6E6D6;
    font-family: "Lucida Console", "Courier New", Courier, monospace;
    text-align: left;
    font-size: 8pt;
    width: 500px;
}

}
/* -- report ------------------------------------------------------------------------ */
#show_detail_line {
    margin-top: 3ex;
    margin-bottom: 1ex;
}
#result_table {
    width: 80%;
    border-collapse: collapse;
    border: 1px solid #777;
}
#header_row {
    font-weight: bold;
    color: white;
    background-color: #777;
}
#result_table td {
    border: 1px solid #777;
    padding: 2px;
}
#total_row  { font-weight: bold; }
.passClass  { background-color: #6c6; }
.failClass  { background-color: #c60; }
.errorClass { background-color: #c00; }
.passCase   { color: #6c6; }
.failCase   { color: #c60; font-weight: bold; }
.errorCase  { color: #c00; font-weight: bold; }
.hiddenRow  { display: none; }
.testcase   { margin-left: 2em; }


/* -- ending ---------------------------------------------------------------------- */
#ending {
}


.piechart{
    position:absolute;  ;
    top:20px;
    left:300px;
    width: 200px;
    float: left;
    display:  inline;
}


</style>

</head>
<body>
<script language="javascript" type="text/javascript">
output_list = Array();

/* level - 0:Summary; 1:Failed; 2:All */
function showCase(level) {
    trs = document.getElementsByTagName("tr");
    for (var i = 0; i < trs.length; i++) {
        tr = trs[i];
        id = tr.id;
        if (id.substr(0,2) == 'ft') {
            if (level < 1) {
                tr.className = 'hiddenRow';
            }
            else {
                tr.className = '';
            }
        }
        if (id.substr(0,2) == 'pt') {
            if (level > 1) {
                tr.className = '';
            }
            else {
                tr.className = 'hiddenRow';
            }
        }
    }
}


function showClassDetail(cid, count) {
    var id_list = Array(count);
    var toHide = 1;
    for (var i = 0; i < count; i++) {
        tid0 = 't' + cid.substr(1) + '.' + (i+1);
        tid = 'f' + tid0;
        tr = document.getElementById(tid);
        if (!tr) {
            tid = 'p' + tid0;
            tr = document.getElementById(tid);
        }
        id_list[i] = tid;
        if (tr.className) {
            toHide = 0;
        }
    }
    for (var i = 0; i < count; i++) {
        tid = id_list[i];
        if (toHide) {
            document.getElementById('div_'+tid).style.display = 'none'
            document.getElementById(tid).className = 'hiddenRow';
        }
        else {
            document.getElementById(tid).className = '';
        }
    }
}


function showTestDetail(div_id){
    var details_div = document.getElementById(div_id)
    var displayState = details_div.style.display
    // alert(displayState)
    if (displayState != 'block' ) {
        displayState = 'block'
        details_div.style.display = 'block'
    }
    else {
        details_div.style.display = 'none'
    }
}


function html_escape(s) {
    s = s.replace(/&/g,'&amp;');
    s = s.replace(/</g,'&lt;');
    s = s.replace(/>/g,'&gt;');
    return s;
}

function drawCircle(pass, fail, error){
    var color = ["#6c6","#c60","#c00"];
    var data = [pass,fail,error];
    var text_arr = ["pass", "fail", "error"];

    var canvas = document.getElementById("circle");
    var ctx = canvas.getContext("2d");
    var startPoint=0;
    var width = 20, height = 10;
    var posX = 112 * 2 + 20, posY = 30;
    var textX = posX + width + 5, textY = posY + 10;
    for(var i=0;i<data.length;i++){
        ctx.fillStyle = color[i];
        ctx.beginPath();
        ctx.moveTo(112,84);
        ctx.arc(112,84,84,startPoint,startPoint+Math.PI*2*(data[i]/(data[0]+data[1]+data[2])),false);
        ctx.fill();
        startPoint += Math.PI*2*(data[i]/(data[0]+data[1]+data[2]));
        ctx.fillStyle = color[i];
        ctx.fillRect(posX, posY + 20 * i, width, height);
        ctx.moveTo(posX, posY + 20 * i);
        ctx.font = 'bold 14px';
        ctx.fillStyle = color[i];
        var percent = text_arr[i] + ":"+data[i];
        ctx.fillText(percent, textX, textY + 20 * i);

    }
}

function show_shots(obj) {
	obj.nextElementSibling.style.display="block";

}

function close_shots(obj) {
	obj.parentElement.style.display="none";
}

</script>
<div class="piechart">
    <div>
        <canvas id="circle" width="350" height="168" </canvas>
    </div>
</div>
<div class='heading'>
<h1>测试报告</h1>
<p class='attribute'><strong>开始时间:</strong> 2019-05-06 22:04:27</p>
<p class='attribute'><strong>耗时:</strong> 0:00:00.625326</p>
<p class='attribute'><strong>状态:</strong> <span class="tj passCase">Pass</span>3 <span class="tj failCase">Failure</span>1</p>

<p class='description'>用例执行情况</p>
</div>



<p id='show_detail_line'>显示
<a href='javascript:showCase(0)'>概要</a>
<a href='javascript:showCase(1)'>失败</a>
<a href='javascript:showCase(2)'>所有</a>
</p>

<table id='result_table'>
<colgroup>
<col align='left' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
<col align='right' />
</colgroup>
<tr id='header_row'>
    <td>测试组/测试用例</td>
    <td>总数</td>
    <td>通过</td>
    <td>失败</td>
    <td>错误</td>
    <td>视图</td>
    <td>错误截图</td>
</tr>

<tr class='failClass'>
    <td>test_api.Test_api</td>
    <td>4</td>
    <td>3</td>
    <td>1</td>
    <td>0</td>
    <td><a href="javascript:showClassDetail('c1',4)">详情</a></td>
    <td>&nbsp;</td>
</tr>

<tr id='pt1.1' class='hiddenRow'>
    <td ><div class='testcase'>test_api_1</div></td>
    <td colspan='5' align='center'>

    <!--css div popup start-->
    <span class='status passCase'>
    <a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_pt1.1')" >
        通过</a></span>

    <div id='div_pt1.1' class="popup_window">
        <div style='text-align: right; color:red;cursor:pointer'>
        <a onfocus='this.blur();' onclick="document.getElementById('div_pt1.1').style.display = 'none' " >
           [x]</a>
        </div>
        <pre>
        
pt1.1: *******正在执行用例：-----  t_001  ----**********
请求方式：get, 请求url:http://japi.juhe.cn/qqevaluate/qq
请求params：{'key': '8dbee1fcd8627fb6699bce7b986adc45', 'qq': '283340479'}
页面返回信息：{"error_code":0,"reason":"success","result":{"data":{"conclusion":"[凶]如走夜路，前途无光，希望不大，劳而无功","analysis":"一生就像在夜晚里走路一样，想开创新天地，却部是难以大展拳脚，可用好做好现在的事情，等待时机，主动出击容易空手而回，此命需待贵人相助方容易成功。"}}}
用例测试结果:   t_001----&gt;pass
检查点-&gt;："reason":"success"
返回实际结果-&gt;：{"error_code":0,"reason":"success","result":{"data":{"conclusion":"[凶]如走夜路，前途无光，希望不大，劳而无功","analysis":"一生就像在夜晚里走路一样，想开创新天地，却部是难以大展拳脚，可用好做好现在的事情，等待时机，主动出击容易空手而回，此命需待贵人相助方容易成功。"}}}


        </pre>
    </div>
    <!--css div popup end-->

    </td>
    <td></td>
</tr>

<tr id='pt1.2' class='hiddenRow'>
    <td ><div class='testcase'>test_api_2</div></td>
    <td colspan='5' align='center'>

    <!--css div popup start-->
    <span class='status passCase'>
    <a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_pt1.2')" >
        通过</a></span>

    <div id='div_pt1.2' class="popup_window">
        <div style='text-align: right; color:red;cursor:pointer'>
        <a onfocus='this.blur();' onclick="document.getElementById('div_pt1.2').style.display = 'none' " >
           [x]</a>
        </div>
        <pre>
        
pt1.2: *******正在执行用例：-----  t_002  ----**********
请求方式：get, 请求url:http://japi.juhe.cn/qqevaluate/qq
请求params：{'key': 'ce7b986adc45', 'qq': '283340479'}
页面返回信息：
{"resultcode":"101","reason":"KEY ERROR!","result":[],"error_code":10001}
用例测试结果:   t_002----&gt;pass
检查点-&gt;："reason":"KEY ERROR!"
返回实际结果-&gt;：
{"resultcode":"101","reason":"KEY ERROR!","result":[],"error_code":10001}


        </pre>
    </div>
    <!--css div popup end-->

    </td>
    <td></td>
</tr>

<tr id='ft1.3' class='none'>
    <td ><div class='testcase'>test_api_3</div></td>
    <td colspan='5' align='center'>

    <!--css div popup start-->
    <span class='status failCase'>
    <a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_ft1.3')" >
        失败</a></span>

    <div id='div_ft1.3' class="popup_window">
        <div style='text-align: right; color:red;cursor:pointer'>
        <a onfocus='this.blur();' onclick="document.getElementById('div_ft1.3').style.display = 'none' " >
           [x]</a>
        </div>
        <pre>
        
ft1.3: *******正在执行用例：-----  t_003  ----**********
请求方式：get, 请求url:http://v.juhe.cn/weather/index
请求params：{'cityname': '上海', 'dtype': 'json', 'format': '1', 'key': '7f7aef918433540d1e989bcc3dbee3fd'}
页面返回信息：{"resultcode":"200","reason":"successed!","result":{"sk":{"temp":"14","wind_direction":"西北风","wind_strength":"1级","humidity":"46%","time":"21:51"},"today":{"temperature":"14℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东北风3-5级","week":"星期一","city":"上海","date_y":"2019年05月06日","dressing_index":"较冷","dressing_advice":"建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。","uv_index":"弱","comfort_index":"","wash_index":"较不宜","travel_index":"较不宜","exercise_index":"较不宜","drying_index":""},"future":{"day_20190506":{"temperature":"14℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东北风3-5级","week":"星期一","date":"20190506"},"day_20190507":{"temperature":"15℃~20℃","weather":"多云转阴","weather_id":{"fa":"01","fb":"02"},"wind":"东风3-5级","week":"星期二","date":"20190507"},"day_20190508":{"temperature":"15℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东南风3-5级","week":"星期三","date":"20190508"},"day_20190509":{"temperature":"17℃~24℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东风微风","week":"星期四","date":"20190509"},"day_20190510":{"temperature":"18℃~26℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东南风微风","week":"星期五","date":"20190510"},"day_20190511":{"temperature":"15℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东南风3-5级","week":"星期六","date":"20190511"},"day_20190512":{"temperature":"15℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东南风3-5级","week":"星期日","date":"20190512"}}},"error_code":0}
检查点-&gt;："reason":"查询成功"
返回实际结果-&gt;：{"resultcode":"200","reason":"successed!","result":{"sk":{"temp":"14","wind_direction":"西北风","wind_strength":"1级","humidity":"46%","time":"21:51"},"today":{"temperature":"14℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东北风3-5级","week":"星期一","city":"上海","date_y":"2019年05月06日","dressing_index":"较冷","dressing_advice":"建议着厚外套加毛衣等服装。年老体弱者宜着大衣、呢外套加羊毛衫。","uv_index":"弱","comfort_index":"","wash_index":"较不宜","travel_index":"较不宜","exercise_index":"较不宜","drying_index":""},"future":{"day_20190506":{"temperature":"14℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东北风3-5级","week":"星期一","date":"20190506"},"day_20190507":{"temperature":"15℃~20℃","weather":"多云转阴","weather_id":{"fa":"01","fb":"02"},"wind":"东风3-5级","week":"星期二","date":"20190507"},"day_20190508":{"temperature":"15℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东南风3-5级","week":"星期三","date":"20190508"},"day_20190509":{"temperature":"17℃~24℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东风微风","week":"星期四","date":"20190509"},"day_20190510":{"temperature":"18℃~26℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东南风微风","week":"星期五","date":"20190510"},"day_20190511":{"temperature":"15℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东南风3-5级","week":"星期六","date":"20190511"},"day_20190512":{"temperature":"15℃~20℃","weather":"多云","weather_id":{"fa":"01","fb":"01"},"wind":"东南风3-5级","week":"星期日","date":"20190512"}}},"error_code":0}
Traceback (most recent call last):
  File "F:\A_RuanJian\python37\lib\site-packages\ddt.py", line 145, in wrapper
    return func(self, *args, **kwargs)
  File "F:\A_RuanJian\Py_project\excel_ddt_youyou\case\test_api.py", line 40, in test_api
    self.assertTrue(check in res_text)
AssertionError: False is not true


        </pre>
    </div>
    <!--css div popup end-->

    </td>
    <td></td>
</tr>

<tr id='pt1.4' class='hiddenRow'>
    <td ><div class='testcase'>test_api_4</div></td>
    <td colspan='5' align='center'>

    <!--css div popup start-->
    <span class='status passCase'>
    <a class="popup_link" onfocus='this.blur();' href="javascript:showTestDetail('div_pt1.4')" >
        通过</a></span>

    <div id='div_pt1.4' class="popup_window">
        <div style='text-align: right; color:red;cursor:pointer'>
        <a onfocus='this.blur();' onclick="document.getElementById('div_pt1.4').style.display = 'none' " >
           [x]</a>
        </div>
        <pre>
        
pt1.4: 请求头部：{'Accept-Encoding': 'gzip, deflate', 'Content-Type': 'application/x-www-form-urlencoded', 'Host': 'api.zxyjsc.com', 'Connection': 'Keep-Alive', 'User-Agent': 'okhttp/3.8.0', 'Accept': '*/*', 'cache-control': 'no-cache'}
*******正在执行用例：-----  t_004  ----**********
请求方式：post, 请求url:https://api.zxyjsc.com/flyapi/login
请求params：{'version': '1.0', 'terminal': '1'}
post请求body类型为：data ,body内容为：{'username': '18825189765', 'password': '2cfdbbef4e47899c0eb9a59eb1ad1eb6', 'origin': '1'}
页面返回信息：{"code":0,"message":"恭喜您，登陆成功！","lastUpdateTime":"","data":{"memberId":"db8cf022e85444df8295f2ae8562f563","inviteCode":21391881088,"headImage":"","phone":"18825189765","nickName":"123","wechat":"","wechatOpenId":"","wechatUnionId":"","isStore":0,"userName":"","identityCard":"","memberType":0,"memberTypeStr":"青铜","authStatus":0,"authStatusStr":"未认证","signinStatus":0,"firstPasswrodTag":0,"referrerMemberId":"","email":"","createDate":"2019-04-03 22:52:25","firstAppOrder":0,"xinAppMember":0,"grade":1,"gradeStr":"SV1","authBookDate":""}}
用例测试结果:   t_004----&gt;pass
检查点-&gt;："message":"恭喜您，登陆成功！"
返回实际结果-&gt;：{"code":0,"message":"恭喜您，登陆成功！","lastUpdateTime":"","data":{"memberId":"db8cf022e85444df8295f2ae8562f563","inviteCode":21391881088,"headImage":"","phone":"18825189765","nickName":"123","wechat":"","wechatOpenId":"","wechatUnionId":"","isStore":0,"userName":"","identityCard":"","memberType":0,"memberTypeStr":"青铜","authStatus":0,"authStatusStr":"未认证","signinStatus":0,"firstPasswrodTag":0,"referrerMemberId":"","email":"","createDate":"2019-04-03 22:52:25","firstAppOrder":0,"xinAppMember":0,"grade":1,"gradeStr":"SV1","authBookDate":""}}


        </pre>
    </div>
    <!--css div popup end-->

    </td>
    <td></td>
</tr>

<tr id='total_row'>
    <td>统计</td>
    <td>4</td>
    <td>3</td>
    <td>1</td>
    <td>0</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
</tr>
</table>
<script>
    drawCircle(3, 1, 0)
</script>

<div id='ending'>&nbsp;</div>

</body>
</html>
